home *** CD-ROM | disk | FTP | other *** search
Wrap
MMMMPPPPIIIINNNN((((2222)))) MMMMPPPPIIIINNNN((((2222)))) NNNNAAAAMMMMEEEE mpin, munpin - lock pages in memory SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS iiiinnnntttt mmmmppppiiiinnnn ((((vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssiiiizzzzeeee____tttt))));;;; iiiinnnntttt mmmmuuuunnnnppppiiiinnnn ((((vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssiiiizzzzeeee____tttt))));;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _mmmm_pppp_iiii_nnnn reads into memory all pages over the range (_a_d_d_r, _a_d_d_r + _l_e_n), and locks the pages into memory. Associated with each locked page is a counter which is incremented each time the page is locked. The super- user can lock as many pages as it wishes, other users are limited to a configurable per process maximum. _mmmm_uuuu_nnnn_pppp_iiii_nnnn decrements the lock counter associated with the pages over the range (_a_d_d_r, _a_d_d_r + _l_e_n). Pages whose counters are zero are available to be swapped out at the system's discretion. _mmmm_pppp_iiii_nnnn or _mmmm_uuuu_nnnn_pppp_iiii_nnnn will fail if one or more of the following are true: [EINVAL] The addresses specified by (_a_d_d_r, _a_d_d_r + _l_e_n) are not mapped into the user's address space. [EAGAIN] There was insufficient lockable memory to lock the entire address range (_a_d_d_r, _a_d_d_r + _l_e_n). This may occur even though the amount requested was less than the system- imposed maximum number of locked pages. [EBUSY] _mmmm_uuuu_nnnn_pppp_iiii_nnnn will fail with this error if the address range specified has some active _IIII_////_OOOO initiated by some other process belonging to same share group. [ENOMEM] The caller was not super-user and the number of pages to be locked exceeded the per process limit {_P_L_O_C_K__M_A_X} [see _iiii_nnnn_tttt_rrrr_oooo(2)]. [ENOMEM] The total number of pages locked by the caller would exceed the maximum resident size for the process [see _s_e_t_r_l_i_m_i_t(2)]. [ENOSPC] The address range (_a_d_d_r, _a_d_d_r + _l_e_n) contains a memory- mapped file, and there is insufficient space on the device to allocate the entire file. SSSSEEEEEEEE AAAALLLLSSSSOOOO intro(2), getrlimit(2), mlock(3C), mlockall(3C), plock(2), ulimit(2). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS Upon successful completion, _mmmm_pppp_iiii_nnnn and _mmmm_uuuu_nnnn_pppp_iiii_nnnn return 0. Otherwise, a value of -1 is returned and _e_r_r_n_o is set to indicate the error. PPPPaaaaggggeeee 1111 MMMMPPPPIIIINNNN((((2222)))) MMMMPPPPIIIINNNN((((2222)))) WWWWAAAARRRRNNNNIIIINNNNGGGG The functions _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk provide similar functionality. The major difference between the two sets is that _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn maintains a per page lock counter and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk does not. Developers should choose the set that best suites their application and stick with it, as mixing the interfaces may result in unexpected behavior. PPPPaaaaggggeeee 2222